﻿@model MVC0721.Models.GuestResponse

@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Thanks</title>
<link href="~/Content/bootstrap.css" rel="stylesheet"/>
</head>
<body>
    @* 使用webmail发送邮件 *@
@{ 
    try
    {
        WebMail.SmtpServer = "stmp.example.com";
        WebMail.SmtpPort = 587;
        WebMail.EnableSsl = true;
        WebMail.UserName = "mySmtpUsername";
        WebMail.Password = "mySmtpPassword";
        WebMail.From = "rsvp@example.com";
        WebMail.Send("party-host@example.com", "RSVP Notification", Model.Name + "is" + ((Model.WillAttend ?? false) ? "" : "not") + "attending");
    }
    catch (Exception)
    {
        @:<b>Sorry - web couldn't send the email to confirm you RSVP.</b>
    }
}
    <div class="text-center"> 
        <h1>谢谢你，Thank you @Model.Name!</h1>
        <div class="lead">
            @if (Model.WillAttend == true)
            {
                @:这是一个好主意，我会光临的！
            }
            else
            {
                @:抱歉，我不能莅临现场，非常感谢邀请！
            }
        </div>
    </div>
</body>
</html>
